

/**
 * 公共底部导航
 */
function fixBottomNav(name) {

  //创建div
  const div = document.createElement('div')

  //添加类名
  div.className = `bottom-nav dpflex`;

  //添加HTML内容
  div.innerHTML = `
    <a href="./home.html" class="nav-link ${name === 'home' ? 'active' : ''} ">
      <i class="iconfont icon-shouye"></i>
      <span>首页</span>
    </a>
    <a href="./sport.html" class="nav-link ${name === 'sport' ? 'active' : ''}">
      <i class="iconfont icon-yundongjulebu"></i>
      <span>运动</span>
    </a>
    <a href="./ring.html" class="nav-link ${name === 'ring' ? 'active' : ''}">
      <i class="iconfont icon-pintu""></i>
      <span>圈子</span>
    </a>
    <a href="./mine.html" class="nav-link ${name === 'mine' ? 'active' : ''} ">
      <i class="iconfont icon-my"></i>
      <span>我的</span>
    </a>
  `

  //将div追加到body中
  document.body.append(div)

}


//导出对象
module.exports = {
  fixBottomNav
}